home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / comm / tcp / ATCP_src_22.lha / AmiTCP-2.2 / src / amitcp / sys / cdefs.h next >
Encoding:
C/C++ Source or Header  |  1993-08-12  |  5.1 KB  |  151 lines

  1. /*
  2.  * $Id: cdefs.h,v 1.11 1993/06/04 11:16:15 jraja Exp $
  3.  *
  4.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  5.  *                    Helsinki University of Technology, Finland.
  6.  *                    All rights reserved.
  7.  *
  8.  * HISTORY
  9.  * $Log: cdefs.h,v $
  10.  * Revision 1.11  1993/06/04  11:16:15  jraja
  11.  * Fixes for first public release.
  12.  *
  13.  * Revision 1.10  1993/05/17  01:02:04  ppessi
  14.  * Changed RCS version
  15.  *
  16.  * Revision 1.9  1993/05/05  16:10:47  puhuri
  17.  * Fixes for final demo.
  18.  *
  19.  * Revision 1.8  93/04/13  21:56:30  21:56:30  jraja (Jarno Tapio Rajahalme)
  20.  * Added new keyword: ALIGNED.
  21.  * 
  22.  * Revision 1.7  93/04/11  22:21:36  22:21:36  jraja (Jarno Tapio Rajahalme)
  23.  * Added function modifier STKARGFUN to be used with functions whose arguments
  24.  * MUST be passed in stack.
  25.  * 
  26.  * Revision 1.6  93/03/07  00:57:12  00:57:12  jraja (Jarno Tapio Rajahalme)
  27.  * Added definition for REGARGFUN keyword.
  28.  * 
  29.  * Revision 1.5  93/03/03  20:08:54  20:08:54  jraja (Jarno Tapio Rajahalme)
  30.  * Removed redundant copyright message.
  31.  * 
  32.  * Revision 1.4  93/03/03  20:06:32  20:06:32  jraja (Jarno Tapio Rajahalme)
  33.  * Cleanup. Changed _CDEFS_H_ to SYS_CDEFS_H.
  34.  * 
  35.  * Revision 1.3  93/03/03  12:32:04  12:32:04  jraja (Jarno Tapio Rajahalme)
  36.  * Fixed _SASC_60 to __SASC_60.
  37.  * Added SAVEDS definition.
  38.  * 
  39.  * Revision 1.2  92/12/22  00:26:32  00:26:32  jraja (Jarno Tapio Rajahalme)
  40.  * Added trailing underscores to __GNUC__ keywords and SASC6.0 inline
  41.  * definition
  42.  * 
  43.  * Revision 1.1  92/11/20  15:41:43  15:41:43  jraja (Jarno Tapio Rajahalme)
  44.  * Initial revision
  45.  * 
  46.  *
  47.  */
  48.  
  49. /*
  50.  * Copyright (c) 1991 The Regents of the University of California.
  51.  * All rights reserved.
  52.  *
  53.  * Redistribution and use in source and binary forms, with or without
  54.  * modification, are permitted provided that the following conditions
  55.  * are met:
  56.  * 1. Redistributions of source code must retain the above copyright
  57.  *    notice, this list of conditions and the following disclaimer.
  58.  * 2. Redistributions in binary form must reproduce the above copyright
  59.  *    notice, this list of conditions and the following disclaimer in the
  60.  *    documentation and/or other materials provided with the distribution.
  61.  * 3. All advertising materials mentioning features or use of this software
  62.  *    must display the following acknowledgement:
  63.  *    This product includes software developed by the University of
  64.  *    California, Berkeley and its contributors.
  65.  * 4. Neither the name of the University nor the names of its contributors
  66.  *    may be used to endorse or promote products derived from this software
  67.  *    without specific prior written permission.
  68.  *
  69.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  70.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  71.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  72.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  73.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  74.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  75.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  76.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  77.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  78.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  79.  * SUCH DAMAGE.
  80.  *
  81.  *    @(#)cdefs.h    7.6 (Berkeley) 5/4/91
  82.  */
  83.  
  84. #ifndef    SYS_CDEFS_H
  85. #define    SYS_CDEFS_H
  86.  
  87. #if defined(__cplusplus)
  88. #define    __BEGIN_DECLS    extern "C" {
  89. #define    __END_DECLS    };
  90. #else
  91. #define    __BEGIN_DECLS
  92. #define    __END_DECLS
  93. #endif
  94.  
  95. /*
  96.  * SAVEDS should be used in all function definitions which will be called 
  97.  * from other tasks than AmiTCP/IP. Is restores the global data base pointer
  98.  * as the first thing in the function body.
  99.  *
  100.  * REGARGFUN contains special keywords which should be used when functions
  101.  * used through shared library are referenced.
  102.  */
  103. #if __SASC_60
  104. #define SAVEDS __saveds
  105. #define REGARGFUN __asm
  106. #define STKARGFUN __stdargs
  107. #define ALIGNED __aligned
  108. #else
  109. #define SAVEDS
  110. #define REGARGFUN
  111. #define STKARGFUN
  112. #define ALIGNED
  113. #endif
  114.  
  115. /*
  116.  * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
  117.  * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
  118.  * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
  119.  * in between its arguments.  __CONCAT can also concatenate double-quoted
  120.  * strings produced by the __STRING macro, but this only works with ANSI C.
  121.  */
  122. #if defined(__STDC__) || defined(__cplusplus)
  123. #define    __P(protos)    protos        /* full-blown ANSI C */
  124. #define    __CONCAT(x,y)    x ## y
  125. #define    __STRING(x)    #x
  126.  
  127. #if __SASC_60
  128. #define inline          __inline
  129. #endif
  130.  
  131. #else    /* !(__STDC__ || __cplusplus) */
  132. #define    __P(protos)    ()        /* traditional C preprocessor */
  133. #define    __CONCAT(x,y)    x/**/y
  134. #define    __STRING(x)    "x"
  135.  
  136. #if __GNUC__
  137. #define    const        __const__    /* GCC: ANSI C with -traditional */
  138. #define    inline        __inline__
  139. #define    signed        __signed__
  140. #define    volatile    __volatile__
  141.  
  142. #else    /* !__GNUC__ */
  143. #define    const                /* delete ANSI C keywords */
  144. #define    inline
  145. #define    signed
  146. #define    volatile
  147. #endif    /* !__GNUC__ */
  148. #endif    /* !(__STDC__ || __cplusplus) */
  149.  
  150. #endif /* !SYS_CDEFS_H */
  151.